<?

/*
$_table = 'CR_CLASSIFICATOR_VALUE o';
$_parent_key = 'classificatorvalue_id';

$res = array();
//dbdebug();

$id = gccHuuid(param('parent'));

while ($id && $d = datafetch('db_item', $_table, 
	"id=$id", "id, name, $_parent_key parent_id")) {
	
	$res[] = array('id' => $d['id'], 'name' => $d['name']);
	$id = $d['parent_id'];
}
	
*/



header("Content-Type: application/json; charset=utf-8");
print json_encode(gccProblemToRoot(param('parent')));

exit;